home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmEcho.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  6.4 KB  |  216 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmEcho 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Echo Effects Update"
  6.    ClientHeight    =   3090
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3090
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.CheckBox chkPan 
  18.       Caption         =   "Pan Delay Max"
  19.       Height          =   195
  20.       Left            =   120
  21.       TabIndex        =   9
  22.       Top             =   2340
  23.       Width           =   2535
  24.    End
  25.    Begin VB.CommandButton cmdOK 
  26.       Caption         =   "OK"
  27.       Height          =   315
  28.       Left            =   1800
  29.       TabIndex        =   8
  30.       Top             =   2700
  31.       Width           =   915
  32.    End
  33.    Begin MSComctlLib.Slider sldFeedback 
  34.       Height          =   195
  35.       Left            =   60
  36.       TabIndex        =   0
  37.       Top             =   360
  38.       Width           =   2655
  39.       _ExtentX        =   4683
  40.       _ExtentY        =   344
  41.       _Version        =   393216
  42.       LargeChange     =   10
  43.       Max             =   100
  44.       SelStart        =   1
  45.       TickFrequency   =   10
  46.       Value           =   1
  47.    End
  48.    Begin MSComctlLib.Slider sldLeft 
  49.       Height          =   195
  50.       Left            =   60
  51.       TabIndex        =   2
  52.       Top             =   900
  53.       Width           =   2655
  54.       _ExtentX        =   4683
  55.       _ExtentY        =   344
  56.       _Version        =   393216
  57.       LargeChange     =   100
  58.       SmallChange     =   10
  59.       Min             =   1
  60.       Max             =   2000
  61.       SelStart        =   1
  62.       TickFrequency   =   100
  63.       Value           =   1
  64.    End
  65.    Begin MSComctlLib.Slider sldRight 
  66.       Height          =   195
  67.       Left            =   60
  68.       TabIndex        =   4
  69.       Top             =   1440
  70.       Width           =   2655
  71.       _ExtentX        =   4683
  72.       _ExtentY        =   344
  73.       _Version        =   393216
  74.       LargeChange     =   100
  75.       SmallChange     =   10
  76.       Min             =   1
  77.       Max             =   2000
  78.       SelStart        =   1
  79.       TickFrequency   =   100
  80.       Value           =   1
  81.    End
  82.    Begin MSComctlLib.Slider sldWetDry 
  83.       Height          =   195
  84.       Left            =   60
  85.       TabIndex        =   6
  86.       Top             =   1980
  87.       Width           =   2655
  88.       _ExtentX        =   4683
  89.       _ExtentY        =   344
  90.       _Version        =   393216
  91.       LargeChange     =   10
  92.       SmallChange     =   5
  93.       Max             =   100
  94.       SelStart        =   1
  95.       TickFrequency   =   10
  96.       Value           =   1
  97.    End
  98.    Begin VB.Label lbl 
  99.       BackStyle       =   0  'Transparent
  100.       Caption         =   "Wet Dry Mix"
  101.       Height          =   255
  102.       Index           =   4
  103.       Left            =   60
  104.       TabIndex        =   7
  105.       Top             =   1740
  106.       Width           =   1035
  107.    End
  108.    Begin VB.Label lbl 
  109.       BackStyle       =   0  'Transparent
  110.       Caption         =   "Right Delay"
  111.       Height          =   255
  112.       Index           =   3
  113.       Left            =   60
  114.       TabIndex        =   5
  115.       Top             =   1200
  116.       Width           =   1035
  117.    End
  118.    Begin VB.Label lbl 
  119.       BackStyle       =   0  'Transparent
  120.       Caption         =   "Left Delay"
  121.       Height          =   255
  122.       Index           =   0
  123.       Left            =   60
  124.       TabIndex        =   3
  125.       Top             =   660
  126.       Width           =   735
  127.    End
  128.    Begin VB.Label lbl 
  129.       BackStyle       =   0  'Transparent
  130.       Caption         =   "Feedback"
  131.       Height          =   255
  132.       Index           =   1
  133.       Left            =   60
  134.       TabIndex        =   1
  135.       Top             =   120
  136.       Width           =   735
  137.    End
  138. Attribute VB_Name = "frmEcho"
  139. Attribute VB_GlobalNameSpace = False
  140. Attribute VB_Creatable = False
  141. Attribute VB_PredeclaredId = True
  142. Attribute VB_Exposed = False
  143. Option Explicit
  144. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  145. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  146. '  File:       frmEcho.frm
  147. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  148. Private oBuffer As DirectSoundSecondaryBuffer8
  149. Private mlIndex As Long
  150. Private oFX As DirectSoundFXEcho8
  151. Private Sub SaveAllSettings()
  152.     Dim fxNew As DSFXECHO
  153.     'Ok, save these new settings
  154.     'Set the new information up
  155.     With fxNew
  156.         .fFeedback = CSng(sldFeedback.Value)
  157.         .fLeftDelay = CSng(sldLeft.Value)
  158.         .fRightDelay = CSng(sldRight.Value)
  159.         .fWetDryMix = CSng(sldWetDry.Value)
  160.         .lPanDelay = chkPan.Value
  161.     End With
  162.     'Now update the effect
  163.     oFX.SetAllParameters fxNew
  164. End Sub
  165. Private Sub chkPan_Click()
  166.     SaveAllSettings
  167. End Sub
  168. Private Sub cmdOK_Click()
  169.     SaveAllSettings
  170.     Unload Me
  171. End Sub
  172. Private Sub Form_Load()
  173.     Dim fxCurrent As DSFXECHO
  174.     'Get the echo interface
  175.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_ECHO, mlIndex, IID_DirectSoundFXEcho)
  176.     'Get the current settings from it
  177.     fxCurrent = oFX.GetAllParameters
  178.     'Now put them out there
  179.     With fxCurrent
  180.         sldFeedback.Value = CLng(.fFeedback)
  181.         sldLeft.Value = CLng(.fLeftDelay)
  182.         sldRight.Value = CLng(.fRightDelay)
  183.         sldWetDry.Value = CLng(.fWetDryMix)
  184.         chkPan.Value = .lPanDelay
  185.     End With
  186. End Sub
  187. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  188.     'Store the buffer and index
  189.     Set oBuffer = oBuf
  190.     mlIndex = Index
  191. End Sub
  192. Private Sub sldFeedback_Change()
  193.     SaveAllSettings
  194. End Sub
  195. Private Sub sldFeedback_Scroll()
  196.     SaveAllSettings
  197. End Sub
  198. Private Sub sldLeft_Change()
  199.     SaveAllSettings
  200. End Sub
  201. Private Sub sldLeft_Scroll()
  202.     SaveAllSettings
  203. End Sub
  204. Private Sub sldRight_Change()
  205.     SaveAllSettings
  206. End Sub
  207. Private Sub sldRight_Scroll()
  208.     SaveAllSettings
  209. End Sub
  210. Private Sub sldWetDry_Change()
  211.     SaveAllSettings
  212. End Sub
  213. Private Sub sldWetDry_Scroll()
  214.     SaveAllSettings
  215. End Sub
  216.